<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="root">
<!--        //自定义click事件-->
        <child @click="handleClick"></child>
    </div>

    <script>
        // 原生click事件
        Vue.component("child",{
            template:"<div @click='handleChildClick'>Child</div>",
            methods:{
                handleChildClick: function () {
                    // alert("child click")
                    this.$emit("click")
                }
            }
        });

        var vm = new Vue({
            el:"#root",
            methods:{
                handleClick:function () {
                    alert("click")
                }
            }
        })
    </script>

</body>
</html>